﻿using NodeEditor;

namespace ETHotfix
{
    public interface  INodeHandle
    {
        void Handle(RuntimeTree runtimeTree,RuntimeNode runtimeNode, Unit unit);
    }

    public abstract class NodeHandle<T> : INodeHandle where T:NodeEditor.AbstractNode
    {
        public void Handle(RuntimeTree runtimeTree, RuntimeNode runtimeNode, Unit unit)
        {
            OnHandle(runtimeTree, runtimeNode,runtimeNode.node as T, unit);
        }

        protected abstract void OnHandle(RuntimeTree runtimeTree, RuntimeNode runtimeNode,T data, Unit unit);
    }
}
